-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Expose camera main color targets #22637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
tychedelia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure here, but part of me wonders whether this shouldn't just be a single Image representing the "base" texture descriptor the other fields are derived from. To start, main_b must always be identical to main_a anyway and in the case that the base descriptor is multi-sampled can be derived from that.
Part of the difficulty here with using Handle<Image> is that if you ever wanted to actually use that handle for some purpose (like displaying it on an image node in another pass), there's no way to know which handle to use, since the "correct" handle cannot be determined in the main world.
This is also a way of asking the question: outside of potential ux drawbacks, is there any reason to have separate Hdr and Msaa components when we have the ability to fully specify the descritpro?
|
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
f9e0a23 to
89c6cef
Compare
Objective
This PR combines #22495 and #21357, and proposes a way to fully expose main color targets as a step towards #19704
Solution
MainColorTargetcomponet that specifiesmain_texture_amain_texture_bandmain_texture_multisampled. AndWithMainColorTargetthat links the camera to aMainColorTargetentity, which can be shared by multi cameras.Hdr,MsaaandCameraMainTextureUsagesby default, unless there isNoAutoConfiguredMainColorTargetto opt-out this.MsaaandCameraMainTextureUsagesare no longer extracted and have no effect withNoAutoConfiguredMainColorTarget. In render world, users should query msaa samples and main texture format inExtractedView, and main texture size inExtractedCamera.TODD:
Make sure everything works.
Implement optional texture writeback and input.
Update 2026-1-24:
Implemented color target input and render target, see example https://github.com/beicause/bevy/blob/configure-main-color-target/examples/3d/camera_color_target_graph.rs
Msaa and CameraMainTextureUsages are replaced by a single CameraMainColorTargetConfig.
WithMainColorTarget is self referential for auto configued camera.
Testing
Added a
camera_color_target_graphexample.Modified `split_screen` example that demonstrates sharing main color targets: